Ycopy

Top
Next »
What is Ycopy?

Ycopy is a data migration utility. In short it is a utility that helps you copy files from one disk or folder to another.

Who's it for?

Computer/IT technicians, mainly. Or anyone routinely faced with the sometimes arduous task of trying to copy data from a client or colleagues old drive to a new one. It is also has other uses however.

What Ycopy is not.

Ycopy is a useful utility for the intended purpose. It is not a data recovery tool. It was originally written for and is used at our local computer store. It is not a cure all. If the original drive is physically broken in any way then use of Ycopy will most likely not help. It makes no attempt to restore corrupt files. It is however very good at making the job of copying existing data to a new drive a much more predictable and less time consuming operation than it can otherwise turn out to be.

Why not just use explorer?

Well if you've read this far chances are you may already be aware of the problem. You put the old hard disk in your machine along with the new drive which is to receive the old data. Then you set it copying using standard explorer cut and paste. This is fine as long as there are no problems with the file system on the original disk. But...as soon as the copy in progress finds a file which can't be copied (for whatever reason, maybe it's open but locked for exclusive access or perhaps corrupt in some way) the copy process stops. Leaving you with the time consuming and rather mundane task of trying to workout where and why the file copy stopped and what files remain to be copied.

How does Ycopy help?

Ycopy will copy the files from one drive to another just like a regular copy. The difference being that when it encounters a file that it can't copy (for whatever reason) it doesn't just give up. Instead it makes a note of the file(s) that couldn't be copied and moves on to the next one. When the copy process completes you are left with a printable report that you can then give to the client detailing the files which were unable to be copied. Making the job not only easier and much more predictable for you (you set it going and leave it to get on with the job, no more wasted time poring over directories and files) but more professional from the customers perspective (not only did you copy all their precious data that you could but you've given them a detailed list of files that were unable to be saved due to problems with the original disks file system.)

Top
Copyright © 2003-2006. All rights reserved. Ruahine.com Software. License and usage terms.


Usage

« Previous
Usage

This usage guide outlines the process of using Ycopy to move data from one drive (or folder) to another.

1) Configure the hardware

You only need to do this if you want to copy to a destination drive which is not already an installed part of the system. Exactly what you need to do to accomplish this may vary dependent on the specific hardware being used. Configure the original source and destination hard disks so they are detected and usable by windows. Partition and format the destination drive if necessary. Figure 1 shows a typical configuration.

Figure 1. Source drive in foreground, copying to destination drive mounted in the computer. Note the use of an add-on PCI IDE card. We found this can make the process easier by simplifying master/slave configuration.

2) Copy the data

Start Ycopy, you will be presented with the main window, see Figure 2. Select the source drive (or folder) using the upper 'Browse...' button. Select the destination drive (or folder) using the lower 'Browse...' button. You can also make a new folder, using the 'New folder' button in the browse dialog if required*. Click the 'Start Copy' button to start copying the data. As the copy progresses you will see the Status: field display the current file being copied and Statistics: bar being updated with the amount of data copied successfully so far. The report window will list any files that can't be copied. Note that Ycopy should be started by a user account that has administrative privileges.
* The new folder button is not available under Windows 98
Figure 2. Ycopy main window with copy in progress. Note the buttons can be accessed via shortcut keys e.g. Alt + B to browse for the source folder.

3) Wait until the copy completes

When the copy completes, Ycopy will let you know in the Status: bar and the "Busy" bar will stop moving from side to side. The report window will also become editable. At this point you may choose to add to or edit the text of the report. i.e. you might add the customers name to the report for easy reference.

4) Optional - Print the report

As the heading says, this step is optional. It is useful when you want to be able to report back to the customer which files were unable to be copied to the new disk. A typical example would be in a computer shop where you could print out the report and attach it to the customers machine.

Use the "Print" buttton to print directly from Ycopy, the "Notepad" button to open the report in notepad and the "Save" button to save a copy of the report to a file.

« Previous
Top


Command Line

Command Line Invocation

Ycopy can be invoked from the command line.

The general syntax is as follows...

ycopy [/nostart] [/noquit] src_folder [dst_folder]

src_folder - Specifies the source folder for the copy operation.
dst_folder (optional) - Specifies the destination folder for the copy operation.
/nostart (optional) - Specifies that the copy should not begin immediately.
/noquit (optional) - Specifies that that ycopy should not close upon copy completion.

Example.

ycopy C:\source\folder "D:\destination\destination folder"

This would copy the folder C:\source\folder to "D:\destination\destination folder"

Note: If either the source or destination folder name contains spaces you must enclose it in double quotes.


Copy Rules List

Copy Rules List

The copy rules list allows you to specify with a great deal of flexibility exactly which files and folders you want Ycopy to copy and which ones you'd like it to leave alone.

This feature makes use of regular expressions. Regular expressions are a powerful mechanism for text matching. Unfortunately, they can also be very confusing if you've never seen them before. Actually sometimes they can be confusing even if you have seen them before! :-). Don't worry, though, because even if you don't want to learn how to regular expressions you can still use the predefined Ycopy copy rule files available for download on www.ruahine.com.

To access the copy rules list from the main Ycopy dialog click the options button at the bottom. The Ycopy options window will then pop up. Select the "Copy Rules List" tab and you should see a window like the one below (figure 1).

Figure 1) Copy Rules List window.

The top checkbox enables use of the file copy rules in the edit field below it. The middle checkbox enables use of the folder copy in the edit field below it. The last checkbox specifies whether rule matches should be case sensitive or not. Probably best to leave that alone for now. The rest of the dialog lets you load previously saved copy rule files, save the current copy rules to a file and provides a quick way to clear both sets of rules.

Rule syntax.

Each rule starts with either the letter "C" or the letter "D". This specifies the action that is to be taken when this rule matches either the current file being copied or the current folder being copied.

C - Action: Copy the file or folder
D - Action: Don't copy the file or folder

Everything after the first letter is part of a regular expression which defines the pattern to be matched. In the case of figure 1 above the logic of the rules is as follows.

C\.jpg$ - Copy all files that end with ".jpg".
C\.gif$ - Copy all files that end with ".gif".
D - Policy rule. Don't copy files that didn't match any of the rules above.

For more information on the regular expression syntax supported by Ycopy see Appendix A - Regular Expression Syntax .

Important: The last rule can be a single letter "C" or "D". This specifies what to do in the case that no rules match. E.g. "C" will copy by default and "D" will not copy by default. You can only have one such "policy" rule and it must be at the end of all the other rules (if it is omitted the default policy is to copy the file or folder). Also there should be no blank lines in the rules list.

Important: You must check the checkboxes "Enable File/Folder Copy Rules List" or the rules in the edit box below will not be applied during the copy.

If you want to use a specific rule file each time you start Ycopy then load it and set the "Enable File/Folder Copy Rules List" checkboxes appropriately before going to the "General" tab and clicking the button "Save All Settings".

Confused? Some Examples

Perhaps some examples will help explain this.

- Copying images only out of a folder.

This can be accomplished with a ruleset as given in figure 1.

- Skipping temporary files and the Internet Browser Cache.

File rules
D\.tmp$
C

Folder rules
D\\Temporary Internet Files\\$
C

Explanation

This would copy all files except ".tmp" files and all folders except the folder "Temporary Internet Files".

Note: The trailing \\ must be there when matching folders using $ to match the end of the folder name.

- Reproducing a directory structure without the files.

File rules
D

Folder rules
C

Explanation

This ruleset will recreate the directory structure. Basically it just says don't copy any files but do copy all the folders.

- Copying out of a cvs repository.

File rules
D~$
C

Folder rules
D\\CVS\\$
C

Explanation

This ruleset will copy files out of a CVS respository ignoring "backup" files that end in ~ and any folder with the name "CVS".

Need help? Found a bug?

Send me an email support@ruahine.com


Ycopy "Right Click" Menu

Ycopy "Right Click" Menu

If you'd like to be able to right click a folder in explorer as a shortcut to start Ycopy then do the following...

- Start, Run, explorer.
- Tools menu, Folder Options...
- File Types (Tab).
- In the "Registered file types:" list scroll to and select "Folder".
- In the section "Details for 'Folder' filetype", click the button marked "Advanced".
- In the "Edit File Type" dialog, click "New".
- The "New Action" dialog will appear.
- Specify action as "Ycopy" or "Ycopy to".
- Then click the browse button and browse to the location of "ycopy.exe". (Typically C:\Program Files\Ycopy\ycopy.exe)
- Now edit the "Application used to perform action:" section like this...
"C:\Program Files\Ycopy\ycopy.exe" "%L"
-Click "Ok"

(Note that the path to ycopy may be different depending on where you installed ycopy. Also make sure you quote the path as above and include the "%L" which will make Ycopy automatically put the selected folder in as the copy source folder).

After doing this you should then be able to right click on any folder in explorer and select "Ycopy" or "Ycopy to" to easily copy that folder to another location.


Change Log

Change Log

Ycopy 1.0d - New features and bug fixes.

- New buttons to open the report directly in notepad or to save the report to a file.
- Pause button, lets you pause a copy operation and later resume it.
- Fixed bug where a disk full condition wasn't properly detected. Should now give an error. I plan to add support for copy "pre-flighting" soon to try and avoid this situation in the first place (and make the progress bar give some idea of progress)
- Fixed bug calculation of how much data had been when copying for files > 4Gb in size.
- New Options dialog added.
- Added ability to save Ycopy configuration settings to a file ycopy.ini
- New "regular expressions" based Copy Rules List which lets you specify exactly which files and and folders you want copied.
- Moved "help" into an HTMLhelp file ycopy.chm in an effort to keep evrything in one place.


Appendix A - Regular Expression Syntax

 Ycopy Logo

Appendix A - Regular Expression Syntax used by Ycopy's Copy Rules List

For more information see the black list feature.

The following table lists the regular expression metacharacters understood by Ycopy.

Metacharacter
Meaning
.
Matches any single character.
[ ]
Indicates a character class. Matches any character inside the brackets (for example, [abc] matches "a", "b", and "c").
^
If this metacharacter occurs at the start of a character class, it negates the character class. A negated character class matches any character except those inside the brackets (for example, [^abc] matches all characters except "a", "b", and "c").
If ^ is at the beginning of the regular expression, it matches the beginning of the input (for example, ^[abc] will only match input that begins with "a", "b", or "c").
-
In a character class, indicates a range of characters (for example, [0-9] matches any of the digits "0" through "9").
?
Indicates that the preceding expression is optional: it matches once or not at all (for example, [0-9][0-9]? matches "2" and "12").
+
Indicates that the preceding expression matches one or more times (for example, [0-9]+ matches "1", "13", "666", and so on).
*
Indicates that the preceding expression matches zero or more times.
??, +?, *?
Non-greedy versions of ?, +, and *. These match as little as possible, unlike the greedy versions which match as much as possible. Example: given the input "<abc><def>", <.*?> matches "<abc>" while <.*> matches "<abc><def>".
( )
Grouping operator. Example: (\d+,)*\d+ matches a list of numbers separated by commas (such as "1" or "1,23,456").
{ }
Indicates a match group.
\
Escape character: interpret the next character literally (for example, [0- 9]+ matches one or more digits, but [0-9]\+ matches a digit followed by a plus character). Also used for abbreviations (such as \a for any alphanumeric character; see table below).
If \ is followed by a number n, it matches the nth match group (starting from 0). Example: <{.*?}>.*?</\0> matches "<head>Contents</head>".
$
At the end of a regular expression, this character matches the end of the input. Example: [0-9]$ matches a digit at the end of the input.
|
Alternation operator: separates two expressions, exactly one of which matches (for example, T|the matches "The" or "the").
!
Negation operator: the expression following ! does not match the input. Example: a!b matches "a" not followed by "b".
Abbreviations
Ycopy can handle abbreviations, such as \d instead of [0-9]. The abbreviations are provided by the character traits class passed in the CharTraits parameter. The predefined character traits classes provide the following abbreviations.
Abbreviation | Matches
\a | Any alphanumeric character.
\b | White space (blank).
\c | Any alphabetic character.
\d | Any decimal digit.
\h | Any hexadecimal digit.
\n | Newline.
\q | A quoted string.
\w | A simple word.
\z | An integer.

« Previous
Top
Copyright © 2003-2006. All rights reserved. Ruahine.com Software. License and usage terms.


Appendix A - Regular Expression Syntax used by Ycopy's Copy Rules List

For more information see the black list feature.

The following table lists the regular expression metacharacters understood by Ycopy.

Metacharacter
Meaning

.
Matches any single character.

[ ]
Indicates a character class. Matches any character inside the brackets (for example, [abc] matches "a", "b", and "c").

^
If this metacharacter occurs at the start of a character class, it negates the character class. A negated character class matches any character except those inside the brackets (for example, [^abc] matches all characters except "a", "b", and "c").
If ^ is at the beginning of the regular expression, it matches the beginning of the input (for example, ^[abc] will only match input that begins with "a", "b", or "c").

-
In a character class, indicates a range of characters (for example, [0-9] matches any of the digits "0" through "9").

?
Indicates that the preceding expression is optional: it matches once or not at all (for example, [0-9][0-9]? matches "2" and "12").

+
Indicates that the preceding expression matches one or more times (for example, [0-9]+ matches "1", "13", "666", and so on).

*
Indicates that the preceding expression matches zero or more times.

??, +?, *?
Non-greedy versions of ?, +, and *. These match as little as possible, unlike the greedy versions which match as much as possible. Example: given the input "<abc><def>", <.*?> matches "<abc>" while <.*> matches "<abc><def>".

( )
Grouping operator. Example: (\d+,)*\d+ matches a list of numbers separated by commas (such as "1" or "1,23,456").

{ }
Indicates a match group.

\
Escape character: interpret the next character literally (for example, [0-9]+ matches one or more digits, but [0-9]\+ matches a digit followed by a plus character). Also used for abbreviations (such as \a for any alphanumeric character; see table below).
If \ is followed by a number n, it matches the nth match group (starting from 0). Example: <{.*?}>.*?</\0> matches "<head>Contents</head>".

$
At the end of a regular expression, this character matches the end of the input. Example: [0-9]$ matches a digit at the end of the input.

|
Alternation operator: separates two expressions, exactly one of which matches (for example, T|the matches "The" or "the").

!
Negation operator: the expression following ! does not match the input. Example: a!b matches "a" not followed by "b".

Abbreviations
Ycopy can handle abbreviations, such as \d instead of [0-9]. The abbreviations are provided by the character traits class passed in the CharTraits parameter. The predefined character traits classes provide the following abbreviations.
Abbreviation
Matches

\a
Any alphanumeric character.

\b
White space (blank).

\c
Any alphabetic character.

\d
Any decimal digit.

\h
Any hexadecimal digit.

\n
Newline.

\q
A quoted string.

\w
A simple word.

\z
An integer.